<?php

use yii\helpers\Html;
use yii\widgets\Breadcrumbs;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model app\models\ExcelPd */

$title = '';
switch ($type) {
	case 'pdf': $title = 'PD复诊'; break;
	case 'pdx': $title = '帕金森病患者营养状况横断面研究病例报告表'; break;
	
	default: $title = strtoupper($type); break;
}
$this->title = '创建'.$title.'表格';
$this->params['breadcrumbs'][] = ['label' => '临床信息', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => '门诊表格', 'url' => ['/clinical/excel']];
$this->params['breadcrumbs'][] = $this->title;

$this->registerJsFile('@web/js/excel.js?v=1', ['depends' => 'app\assets\AppAsset']);

?>
<?= Breadcrumbs::widget([
    'homeLink' => ['label' => '医疗管理系统', 'url' => '#'],
    'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
]) ?>

<div class="alert alert-danger" id="error-msg"></div>
<div class="excel-form myForm">

	<?php $form = ActiveForm::begin([
		'method' => 'post',
		'action' => '/clinical/excel/create?type='.strtolower($type),
		'id' => 'ExcelForm',
	]); ?>

	<?= $this->render($type, [
		'form' => $form,
		'model' => $model,
		'pt_rel_list' => $pt_rel_list,
	]) ?>

	<div class="form-group">
		<?= Html::submitButton('保存', ['class' => 'btn btn-success', 'id' => 'submitButton']) ?>

		<?= Html::a('取消', ['index'], ['class' => 'btn btn-success']) ?>
	</div>

	<?php ActiveForm::end(); ?>

</div>
<?php if ($type == 'et') :?>
<div class="crop-avatar">
    <?= $this->render('@app/views/layouts/media.php') ?>
</div>
<?php endif; ?>
